#include <stdio.h>
#include <stdlib.h>

/* run this program using the console pauser or add your own getch, system("pause") or input loop */
/*
double Fac(int n)
{
	double fac = 1;
	int i =0;
	for(i=1;i<=n;i++)
	{
		fac = fac*i;
	}
	return fac;
}
double my_pow(double x,int n){
	double sum = x;
	while(--n)
	{
		sum*=x;
	}
	return sum;
} 
int main(int argc, char *argv[]) {
	double x = 0;
	int n = 0;
	scanf("%lf %d",&x,&n);
	int i =0;
	double sin = 0,num = 0;
	int flag = 2;
	for(i=1;i<=(2*n-1);i+=2)
	{	
		num = my_pow(x,i)/Fac(i);
		if(flag%2)
			num = -num;
		sin += num;	
		flag++;	
	}
	printf("%.8lf",sin);
	return 0;
}
*/
